'use strict';

const Controller = require('./base');
class ChatController extends Controller {

  // 聊天记录
  async list() {
    const ctx = this.ctx;
    ctx.set('Content-Type', 'application/json');
    const list = await ctx.service.chat.list();
    this.success(list);
  }

  // 清空聊天记录
  async clear() {
    const ctx = this.ctx;
    ctx.set('Content-Type', 'application/json');
    const list = await ctx.service.chat.clear();
    this.success({
      msg: "聊天消息已清空"
    });
  }

}

module.exports = ChatController;
